<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - Bootstrap Table</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="/admin/favicon.ico"> 
    <link href="/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/admin/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">

    <!-- <link href="/admin/css/plugins/iCheck/custom.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/chosen/chosen.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/cropper/cropper.min.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/switchery/switchery.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/nouslider/jquery.nouislider.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/datapicker/datepicker3.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet"> -->
    <!-- <link href="/admin/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet"> -->

    <link href="/admin/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">

    <!-- <link href="/admin/css/plugins/clockpicker/clockpicker.css" rel="stylesheet"> -->

    <link href="/admin/css/animate.css" rel="stylesheet">
    <link href="/admin/css/style.css?v=4.1.0" rel="stylesheet">
    

</head>

<body class="">
    <div class="wrapper wrapper-content animated fadeInRight">
        <!-- <div class="ibox-content"> -->
            <!-- <div class="row row-lg"> -->
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content" style="border:0">
                            <form action="/admin/bkuser/bkuser_insert" method="post" class="form-horizontal m-t" id="signupForm" onsubmit="return false">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">父级类名：</label>
                                    <div class="col-sm-8">
                                        <select class="form-control" name="pid" value="">
                                            <option value="0">无</option>
                                        @foreach($arr as $list)
                                            <option value="{{$list->id}}">
                                            @php
                                            substr_count($list->type,',');
                                            echo str_repeat('——',substr_count($list->type,',')-1);
                                            @endphp
                                            {{$list->classify}}</option>       
                                        @endforeach
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">类名：</label>
                                    <div class="col-sm-8">
                                        <input id="classify" name="classify" class="form-control" type="text" value="{{old('classify')}}">
                                    </div>
                                </div>
                                
                                <div class="form-group">
                                    <div class="col-sm-8 col-sm-offset-3">
                                        <button class="btn btn-primary" id="add" type="submit">提交</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            <!-- </div> -->
        <!-- </div> -->
    </div>



    <!-- 全局js -->
    <script src="/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/admin/js/layer.js"></script>

    <!-- 自定义js -->
    <script src="/admin/js/content.js?v=1.0.0"></script>


    <!-- Bootstrap table -->
    <script src="/admin/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/admin/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="/admin/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

    <!-- jQuery Validation plugin javascript-->
    <script src="/admin/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="/admin/js/plugins/validate/messages_zh.min.js"></script>

    <script src="/admin/js/demo/form-validate-demo.js"></script>

    <!-- Peity -->
    <script src="/admin/js/demo/bootstrap-table-demo.js"></script>

    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <!--统计代码，可删除-->
    <script>
        
        // $('form').submit().done(function(){
        //     var index = parent.layer.getFrameIndex(window.name);
        //     parent.layer.close(index);
        // })
        $('#add').click(function(){
            var index = parent.layer.getFrameIndex(window.name);
            $.ajax({
                url:'/admin/goodscategory/goodscategory_insert',
                type:'POST',
                cache:false,
                data:$('#signupForm').serialize(),
                success:function(data){
                    // window.parent.location.reload();
                    if(data==1){
                        layer.msg('添加成功',{'icon':1});
                    }else{
                        layer.msg('添加失败',{'icon':2});
                    }
                    setTimeout(function(){
                        parent.layer.close(index);
                    },1000);
                }
            }).done(function(data){
                window.parent.location.reload();
            }).fail(function(data){
                layer.msg('请正确填写信息');
            })
        })
    </script>

</body>

</html>
